<script setup>
import { getQueryString } from "@/utils/common";
import { showToast } from "vant";
import "vant/es/toast/style";

const u = navigator.userAgent;
const isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端

const getUrl = () => {
  const url = window.location.href;
  const urlArr = url.split("?");
  const code = getQueryString("code", urlArr[1]);
  alert(code);
};

onMounted(() => {
  //首页跳转返回 IOS不兼容页面自动刷新问题
  if (!isAndroid) {
    window.onpageshow = function (event) {
      if (event.persisted) {
        window.location.reload();
      }
    };
  }
  getUrl();
});
</script>
